1
The ISA Contract and Architectural State
AI031 Lesson 3
00:00

The Instruction Set Architecture (ISA) serves as a fundamental abstraction level and a formal contract between software and hardware. While high-level languages like C hide complexity, the ISA exposes the architectural state—the precise configuration of the processor's registers and memory.

1. The Architectural State

An x86-64 CPU defines its state through several key components:

  • Program Counter (%rip): Holds the address of the next instruction.
  • Integer Register File: 16 general-purpose registers (e.g., %rax, %rbx) storing 64-bit values.
  • Condition Codes: Flags (ZF, SF, CF, OF) for control flow.
  • Vector Registers: Such as YMM registers (256 bits) for SIMD operations.

2. Memory Abstraction

Machine code views memory as a massive byte-addressable array. While x86-64 supports 64-bit virtual addresses, current implementations often use a 48-bit address space ($2^{48}$ bytes). We categorize data sizes as Word (16-bit), Double word (32-bit), and Quad word (64-bit).

CPU (State) %rip (PC) Registers (%rax..) Condition Codes ISA CONTRACT movq, ret, leaq Virtual Memory 0xFFFF... (Stack) 0x0000... (Code)

3. Evolution and Compatibility

Driven by Moore’s Law, Intel has evolved from the 8086 to Core i7 Haswell. The ISA ensures backward compatibility, allowing legacy machine code to execute on modern multi-core, hyperthreaded hardware.

main.py
TERMINAL bash — 80x24
> Ready. Click "Run" to execute.
>